package com.heima.article.task;

import com.heima.article.service.IHotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author WSJ
 * @Date 2022-03-23-21:17
 * @Version 1.0 （版本号）
 */
@Service
public class HotArticleTask {

    @Autowired
    private IHotArticleService articleService;


    @XxlJob("computeHotArticleJob")
    public ReturnT<String> computeHotArticleJob(String param) throws Exception{
        System.out.println("热点文章计算服务开始启动：");
        articleService.compute();
        return ReturnT.SUCCESS;
    }
}
